package com.example.shengyin.service;

import com.example.shengyin.dao.AppointMapper;
import com.example.shengyin.entity.Appoint;

import com.example.shengyin.entity.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AppointService {
    @Autowired
    private AppointMapper dao;

    public int add(Appoint appoint)
    {
        return dao.add(appoint);
    }
    public int update(Appoint appoint)
    {
        return dao.update(appoint);
    }
    public int delByIds(String ids)
    {
        return dao.delByIds(ids);
    }
    public int delById(int id)
    {
        return dao.delById(id);
    }
    public Appoint selectById(Long id) {return dao.selectById(id);}
    public Page selectList(String uname, int pageNo, int pageSize) {
        List<Appoint> list = dao.selectList(uname,pageNo,pageSize);
        int total=dao.fand(uname);
        return new Page(list,pageNo,total,pageSize);
    }
    public int fand(String uname) {
        return dao.fand(uname);
    }

}
